//定义原子状态，它有像redux状态切片
import {atom} from 'recoil';
//定义todoList原子状态，名字叫todoListState，默认值是[1,2,3]
export const todoListState = atom({
    key:'todoListState',
    default:[
        {id:1,text:'redux',completed:true},
        {id:2,text:'mobx',completed:true},
        {id:3,text:'recoil',completed:false}
    ]
})
//再定义一个过滤器的状态，名字叫filterState,默认值是SHOW_ALL
export const filterState = atom({
    key:'filterState',
    default:'SHOW_ALL'
})
console.log(todoListState)
console.log(filterState)
/**
 * SHOW_ALL是显示所有的TODO
 * SHOW_COMPLETED 显示已完成的
 * SHOW_UNCOMPLETED 显示未完成的
 */